{% extends "layout.html" %}
{% load modeltag %}

{% block css_m %}
    <link type="text/css" rel="stylesheet"
          href="/static/plugins/bootstrap-3.3.7-dist/css/bootstrap-datetimepicker.min.css">
    <style>
        #modal-table tbody {
            display: block;
            height: 700px;

            overflow-y: auto;

        }

        #modal-table thead tr {
            display: table;
            width: 1000px;
            table-layout: fixed;
        }
        #modal-table tbody tr {
            display: table;
            width: 1000px;
            table-layout: fixed;
        }




    </style>


{% endblock %}
{% block js_m %}
    <script type="text/javascript"
            src="/static/plugins/bootstrap-3.3.7-dist/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript"
            src="/static/plugins/bootstrap-3.3.7-dist/js/bootstrap-datetimepicker.zh-CN.js"></script>
{% endblock %}

{% block content_body %}
    <div class="page-jumbotron center-block" style="width: 800px">
        <h1>新建回访</h1>
        <div class="container center-block" style="margin-top: 0">
            <div class="row">
                <div class="col-md-10">
                    <h4>{{ customer_obj.name }}
                        <small> {{ customer_obj.get_sex_display }} {{ customer_obj.age }}岁</small>
                        <a class="btn btn-primary" id="indoors">查看到店信息</a>
                    </h4>
                </div>
                <div class="row">
                    <div class="col-md-4">
                        <table class="table table-striped table-hover" style="width: 100%">
                            <tr>
                                <td>联系方式</td>
                                <td>{{ customer_obj.phone }}</td>
                            </tr>
                            <tr>
                                <td>主要症状</td>
                                <td>{{ customer_obj.symptom }}</td>
                            </tr>
                            <tr>
                                <td>病史</td>
                                <td>{{ customer_obj.ill_date_period }}</td>
                            </tr>
                            <tr>
                                <td>状态</td>
                                <td>{{ test_obj.get_trail_or_bought_display }}</td>

                            </tr>


                        </table>
                    </div>
                    <div class="col-md-4">
                        <table class="table table-striped table-hover" style="width: 100%">
                            <tr>
                                <td>末次回访时间</td>
                                <td>{{ rv_obj.create_time }}</td>
                            </tr>
                            <tr>
                                <td>首次进店时间</td>
                                <td>{{ customer_obj.create_time }}</td>
                            </tr>

                            <tr>
                                <td>末次进店时间</td>
                                <td>{{ test_obj.test_date }}</td>
                            </tr>
                            <tr>
                                <td>满意度</td>
                                <td>{{ customer_obj.satisfaction }}</td>
                            </tr>


                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <div class="panel-body center-block" style="width: 800px">
        <form method="post" novalidate>
            {% csrf_token %}
            {% for field in form_add %}
                {% if field.label == "客户id" %}
                    <div class="form-group hidden">
                        <label>{{ field.label }}</label>
                        {{ field }}

                    </div>
                {% else %}
                    <div class="form-group">
                        <label>{{ field.label }}</label>
                        {{ field }}
                        <span class="error_msg">{{ field.errors.0 }}</span>
                    </div>
                {% endif %}

            {% endfor %}

            <button type="submit" class="btn btn-primary">提交</button>
            <a class="btn btn-default" href="/returning_visits/{{ customer_obj.pid }}/list.html/">取 消</a>
        </form>

    </div>








{% endblock %}

{% block content_bottom %}
    {% modals customer_obj.pid %}
    <script>
        $(function () {
            $('#id_create_time').datetimepicker({

                format: 'yyyy-mm-dd hh:ii',
                language: 'zh-CN',
                autoclose: true,
                todayBtn: "linked",
                todayHighlight: true
            });

        })
    </script>
{% endblock %}